package com.neutech.demo.day01;

import java.text.DecimalFormat;

public class Demo01 {
    public static void main(String[] args) {
        DecimalFormat format = new DecimalFormat("0.00");
        int height = 384;
        double m = 0.128;
        double v0 = 0;

        double t2 = 0;
        double g = 9.8;
//        gt^2 = h*2
//        t^2 = 2*h/g
//        t  = sqrt(t2)
//        速度
        t2 = 2*height/g;
        double t = Math.sqrt(t2);
        double v = g*t;
//        重力势能
        double EP = m*g*0;
//        动能
        double EK = (m*v*v)/2;
        System.out.println("到达地面的速度为" + format.format(v) +
                "重力势能为" + format.format(EP) + "动能为" + format.format(EK));
    }
}
